The present invention relates to a method and apparatus for compressing and decompressing a digital image signal using variable-length coding, and especially relates to a digital image compression and decompression method and apparatus for improving the image quality during reproduction of a recorded compressed digital image signal by controlling the format recorded on recording media, and also improving the compression efficiency by determining a permitted bit number and a quantization interval by extracting an activity, during variable-length coding of digital video images containing motion.
Generally, an image compressing method is proposed to efficiently process data of the digital image signal, and is divided into a variable-length coding (VLC) method and a fixed-length coding (FLC) method according to quantized method. In the VLC method for coding the linearly quantized coefficient by assigning a code having a variable length, since the number of bits to be coded is not constant, the chances of mutual influence between the coding units are increased unless the format recorded on the recording media is properly controlled, so that the possibility of error is also increased when performing trick-play operations such as editing and high-speed reproducing.
In the fixed-length coding method for coding a coefficient according to an adaptive quantizing by assigning a code having a constant length, since there is no influence between the coding units, the possibility of error is low during reconstructing, but since the recorded information is limited, the image quality when reconstructing is lowered. That is, if the length of the fixed length code is long, the image quality is good during general reconstructing, but the image quality is bad during trick playing. On the other hand, if the length of the fixed length code is short, the image quality is bad during general reproducing but the image quality is good during trick play. However, when the length of the FLC is long, the image quality during general reproducing is lower than that of the VLC method.
Since, so far, each coding method has been applied to the image compression method separately, compression has been less efficient. Especially, during trick playing, playback is almost impossible. To improve this problem, P. Kauff et al. of Germany disclosed a solution for alternative recording by performing both the VLC and the fixed-length coding during recording, through "A DCT (discrete cosine transform) Coding Scheme for Digital HDTV Recording" (Fourth International Workshop on HDTV and Beyond, Torino, Italy, Sep. 4-6, 1991, Vol. 1.11, pp 43-51). Here, the principle information (including the DC coefficient and low frequency AC coefficients within the block) in a predetermined block unit is fixed-length-coded using an adaptive quantizing output, and then recorded on a predetermined region of recording media. Also, the remaining information (including a high frequency AC coefficients) undergoes variable-length coding using a linear quantization and then is recorded on the remaining region not recorded with the fixed-length code at a recording region on the recording medium assigned to the block (segment unit). The principle information in the next block is recorded on the predetermined recording region assigned to the block as described above, and the remaining information is recorded next to the region of the previous block where the variable-length coding (VLC) is recorded. In other words, under the condition that the region of a recording medium where the FLC and the VLC can be recorded is limited, during recording of the information onto the fixed length coding region and the VLC region assigned to the respective blocks, if the number of bits of the VLC information in the previous block is more than that of the corresponding region, the VLC is recorded onto the region where the VLC of the next block would otherwise be recorded, while, if the number of bits is less than that of the corresponding region, the VLC of the next block is recorded next to the region where the previous VLC was recorded. Accordingly, the image quality is improved compared to the case which adapts the two coding methods separately.
However, in this case, since the coding efficiency is lower than that of VLC, even though the region to be reproduced is widened by fixed-length-coding the principle information, the image quality of the principle information is lowered and the apparatus becomes complicated because of the use of two different coding methods, which increases the price of the end product.